package com.electromagnetic.industry.software.manage.pojo.models;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.electromagnetic.industry.software.common.enums.PublishEnum;
import com.electromagnetic.industry.software.common.util.EleIdCreator;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
@TableName("ed_tag_library")
public class EdTagLibrary extends BaseModel {

    @TableId
    private String tagId;  // 主键 ID
    private String parentId;  // 父 ID，"" 代表是标签组
    private Integer type;  // 0: 标签组, 1: 标签
    private String tagName;  // 标签库或标签名称
    private Integer orderBy;  // 排序字段
    private Integer isPublished;  // 是否已发布（0: 未发布, 1: 已发布）

    public void newInit() {
        this.setTagId(EleIdCreator.createSnowflakeId());
        this.setIsPublished(PublishEnum.UNPUBLISHED.getCode()); //默认未发布
    }
}

